/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package client;

/**
 *
 * @author juan
 */
public class TransferData {
    private int completion,id;
    private String fileName, status, operation;
    private static int counter =0;
    public TransferData(String fileName,String operation) {
        this.fileName = fileName;
        this.operation = operation;
        this.completion = 0;
        this.status = "in progress";
        this.id = counter++;
    }

    public boolean equals(TransferData td) {
        return this.id == td.id;
    }

    public void sync(TransferData td) {
        this.completion = td.completion;
        this.status = td.status;
    }
    public int getCompletion() {
        return this.completion;
    }

    public void setCompletion(int n) {
        this.completion = n;
    }

    public void setStatus(String m) {
        this.status = m;
    }

    public String getFileName() {
        return fileName;
    }

    public String toString() {
        return String.format("%s File: %s completion: %s", operation, fileName, completion);
    }
}
